<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            分配教室
            <small>为教室分配设备</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-gears"></i> 设备管理</a></li>
            <li>编辑设备</li>
            <li><a routerLink="/assignDevice">分配设备</a></li><li>分配教室</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-md-12">


                <!-- Horizontal Form -->
                <div class="box box-info">

                    <!-- /.box-header -->
                    <div class="box-header with-border">
                        <h3 class="box-title">教室信息</h3>
                    </div>
                    <!-- form start -->
                    <form class="form-horizontal">
                        <div class="box-body" id="inputCameraWrapper">
                            <div class="form-group">
                                <label for="addBuilding" class="col-sm-2 control-label">教学楼</label>
                                <div class="col-sm-3">
                                    <select class="form-control" name="addBuilding" [(ngModel)]="assignModel.buildingNum" (ngModelChange)="changeClassroomByBuilding($event)" [disabled]="operate=='edit'">
                                        <option *ngFor="let building of buildings" [value]="building.buildingNum">
                                            {{building.buildingNum}}
                                        </option>
                                    </select>
                                </div>

                                <label for="addClassroom" class="col-sm-1 control-label">教室号</label>

                                <div class="col-sm-3">
                                    <select class="form-control" name="addClassroom" [(ngModel)]="assignModel.classroomNum" [disabled]="operate=='edit'">
                                        <option *ngFor="let classroom of classrooms" [value]="classroom.classroomNum">{{classroom.classroomNum}}</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">电脑信息</label>

                                <div class="col-sm-7">
                                    <select class="form-control" name="addComputerClassroom" [(ngModel)]="assignModel.computerTypeId">
                                        <option *ngFor="let computer of computers" [value]="computer.computerTypeId">
                                                型号：{{computer.computerTypeName}}&nbsp;&nbsp;
                                                内存：{{computer.memorySize}}G&nbsp;&nbsp;
                                                硬盘：{{computer.diskSize}}G&nbsp;&nbsp;
                                                操作系统：{{computer.operatingSystem}}
                                            </option>
                                    </select>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">投影仪信息</label>

                                <div class="col-sm-7">
                                    <select class="form-control" name="addProjectorClassroom" [(ngModel)]="assignModel.projectorTypeId">
                                        <option  *ngFor="let projector of projectors" [value]="projector.projectorTypeId">{{projector.projectorTypeName}}</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">单片机信息</label>

                                <div class="col-sm-7">
                                    <select class="form-control" name="addSinglechipClassroom" [(ngModel)]="assignModel.singlechipTypeId">
                                        <option  *ngFor="let singlechip of singlechips" [value]="singlechip.singlechipTypeId">{{singlechip.singlechipTypeName}}</option>
                                    </select>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">树莓派信息</label>

                                <div class="col-sm-7">
                                    <select class="form-control" name="addRaspberryClassroom" [(ngModel)]="assignModel.raspberryTypeId">
                                        <option *ngFor="let raspberry of raspberrys" [value]="raspberry.raspberryTypeId">{{raspberry.raspberryTypeName}}</option>
                                    </select>
                                </div>
                            </div>
                            <div *ngFor="let item of items;let i = index" class="form-group add-camera">
                                <label class="col-sm-2 control-label">摄像头型号</label>

                                <div class="col-sm-3">
                                    <select class="form-control camera-type" name="addCameraClassroom" [(value)]="item.cameraTypeId">
                                        <option *ngFor="let camera of cameras" [value]="camera.cameraTypeId">{{camera.cameraTypeName}}</option>
                            
                                    </select>
                                </div>
                                <label class="col-sm-1 control-label">名称</label>
                                <span *ngIf="i<1" class="glyphicon glyphicon-plus cursor-hand" aria-hidden="true" (click)="addInput()"></span>
                                <span *ngIf="i>=1" class="glyphicon glyphicon-remove cursor-hand" aria-hidden="true" (click)="removeInput(i,$event)"></span>
                                <div class="col-sm-3">
                                    <input type="text" [(value)]="item.cameraAngle" class="form-control camera-angle" name="addCameraAngleClassroom" placeholder="如：全景、正面、侧面">
                                </div>
                            </div>  
                                  
                        </div>

                        <!-- /.box-body -->
                        <div class="box-footer">
                            <p class="label label-danger classroom-wrong-tip" [ngClass]="{'div-display': judgeTip}" style="margin-top: 5px;float: left;" >{{tip}}</p>
                            <button type="button" class="btn btn-info pull-right" (click)="assignClassroomDevice()">分配教室</button>
                        </div>
                        <!-- /.box-footer -->
                    </form>
                </div>
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->
    </section>
    <!-- /.content -->
</div>
<!-- /.content-wrapper -->